package org.nf.trading.controller.app.circle;

import jakarta.servlet.http.HttpSession;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nf.trading.controller.BaseController;
import org.nf.trading.dto.LikeDTO;
import org.nf.trading.entity.User;
import org.nf.trading.service.app.circle.LikeService;
import org.nf.trading.vo.ResultVO;
import org.springframework.web.bind.annotation.*;

@RestController
@Slf4j
@RequiredArgsConstructor
@RequestMapping("/api/post")
@CrossOrigin
public class LikeController extends BaseController {
    private final LikeService likeService;
    @GetMapping("/like")
    public ResultVO<?> like(Integer postId,Integer uid) {
        System.out.println("帖子id为："+postId);
//        User user = (User) session.getAttribute("user");
        LikeDTO likeDTO = likeService.like(postId, uid);
        return success(likeDTO);
    }
}
